/**
 * lilang
 * CreatRandUtils.java
 * 2013-8-14下午3:13:07
 */
package com.cq.oa.servlet;

import java.io.UnsupportedEncodingException;
import java.util.Random;

/**
 * @author lilang
 * 
 */
public class CreatRandUtils {
	/**
	 * 获取随机汉字
	 * @return
	 * @throws UnsupportedEncodingException
	 * lilang 
	 * 2013-8-14下午3:14:07
	 */
	public static String getRands() throws UnsupportedEncodingException {
		String str = null;
		Random random = new Random();
		int hightPos = (176 + Math.abs(random.nextInt(39)));// 获取高位值
		int lowPos = (161 + Math.abs(random.nextInt(93)));// 获取低位值
		byte[] b = new byte[2];
		b[0] = (new Integer(hightPos).byteValue());
		b[1] = (new Integer(lowPos).byteValue());
		str = new String(b, "GBk");// 转成中文
		return str;
	}

}
